<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddSellerIdRefundTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('refund', function (Blueprint $table) {
            //

            $table->integer('seller_id')->default(-1)->comment('商铺id');

            $table->decimal('goods_price')->unsigned()->comment('商品单价');

            $table->integer('num')->unsigned()->comment('退款数量');

            $table->decimal('refund_price')->unsigned()->comment('退款金额，可能与实际金额不符');

            $table->decimal('real_refund_price')->nullable()->unsigned()->comment('实际退款金额，从接口返回');


        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('refund', function (Blueprint $table) {
            //
            $table->dropColumn('seller_id');

            $table->dropColumn('goods_price');

            $table->dropColumn('num');

            $table->dropColumn('refund_price');

            $table->dropColumn('real_refund_price');

        });
    }
}
